package main
import "fmt"

func main(){
  doDBOperations()
}
func connectToDB(){
  fmt.Println("ok, connect to db")
}
func disconnectFromDB(){
  fmt.Println("ok, disconnected from db")
}
func doDBOperations(){
  connectToDB()
  fmt.Println("Defering the database disconnect")
  defer disconnectFromDB()
  fmt.Println("Doing some DB ops")
  fmt.Println("Oops! some crash or network error ...")
  fmt.Println("Returing from function here!")
  return
}
